3.1.89 \(\int \frac {1}{\sqrt {1-\sin (x)} \sqrt {\sin (x)}} \, dx\) [89]

Optimal. Leaf size=31 \[ \sqrt {2} \tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2} \sqrt {1-\sin (x)} \sqrt {\sin (x)}}\right ) \]

[Out]

arctanh(1/2*cos(x)*2^(1/2)/(1-sin(x))^(1/2)/sin(x)^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2861, 212} \begin {gather*} \sqrt {2} \tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2} \sqrt {1-\sin (x)} \sqrt {\sin (x)}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/(Sqrt[1 - Sin[x]]*Sqrt[Sin[x]]),x]

[Out]

Sqrt[2]*ArcTanh[Cos[x]/(Sqrt[2]*Sqrt[1 - Sin[x]]*Sqrt[Sin[x]])]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2861

Int[1/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> D
ist[-2*(a/f), Subst[Int[1/(2*b^2 - (a*c - b*d)*x^2), x], x, b*(Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c +
 d*Sin[e + f*x]]))], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 -
 d^2, 0]

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {1-\sin (x)} \sqrt {\sin (x)}} \, dx &=-\left (2 \text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,-\frac {\cos (x)}{\sqrt {1-\sin (x)} \sqrt {\sin (x)}}\right )\right )\\ &=\sqrt {2} \tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2} \sqrt {1-\sin (x)} \sqrt {\sin (x)}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
time = 1.29, size = 125, normalized size = 4.03 \begin {gather*} \frac {2 \left (F\left (\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )-\Pi \left (-1-\sqrt {2};\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )-\Pi \left (-1+\sqrt {2};\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )\right ) \sec ^2\left (\frac {x}{4}\right ) \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \sin (x)}{\sqrt {1-\cot ^2\left (\frac {x}{4}\right )} \sqrt {-((-1+\sin (x)) \sin (x))} \tan ^{\frac {3}{2}}\left (\frac {x}{4}\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/(Sqrt[1 - Sin[x]]*Sqrt[Sin[x]]),x]

[Out]

(2*(EllipticF[ArcSin[1/Sqrt[Tan[x/4]]], -1] - EllipticPi[-1 - Sqrt[2], ArcSin[1/Sqrt[Tan[x/4]]], -1] - Ellipti
cPi[-1 + Sqrt[2], ArcSin[1/Sqrt[Tan[x/4]]], -1])*Sec[x/4]^2*(Cos[x/2] - Sin[x/2])*Sin[x])/(Sqrt[1 - Cot[x/4]^2
]*Sqrt[-((-1 + Sin[x])*Sin[x])]*Tan[x/4]^(3/2))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(51\) vs. \(2(24)=48\).
time = 0.36, size = 52, normalized size = 1.68

method result size
default \(-\frac {2 \sqrt {-\frac {-1+\cos \left (x \right )}{\sin \left (x \right )}}\, \left (-1+\cos \left (x \right )+\sin \left (x \right )\right ) \left (\sqrt {\sin }\left (x \right )\right ) \arctanh \left (\sqrt {-\frac {-1+\cos \left (x \right )}{\sin \left (x \right )}}\right )}{\sqrt {1-\sin \left (x \right )}\, \left (-1+\cos \left (x \right )\right )}\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1-sin(x))^(1/2)/sin(x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2*(-(-1+cos(x))/sin(x))^(1/2)*(-1+cos(x)+sin(x))*sin(x)^(1/2)*arctanh((-(-1+cos(x))/sin(x))^(1/2))/(1-sin(x))
^(1/2)/(-1+cos(x))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-sin(x))^(1/2)/sin(x)^(1/2),x, algorithm="maxima")

[Out]

integrate(1/(sqrt(-sin(x) + 1)*sqrt(sin(x))), x)

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 31, normalized size = 1.00 \begin {gather*} \sqrt {2} \log \left (\frac {\sqrt {2} \sqrt {-\sin \left (x\right ) + 1} \sqrt {\sin \left (x\right )} + \cos \left (x\right )}{\sin \left (x\right ) - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-sin(x))^(1/2)/sin(x)^(1/2),x, algorithm="fricas")

[Out]

sqrt(2)*log((sqrt(2)*sqrt(-sin(x) + 1)*sqrt(sin(x)) + cos(x))/(sin(x) - 1))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {1 - \sin {\left (x \right )}} \sqrt {\sin {\left (x \right )}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-sin(x))**(1/2)/sin(x)**(1/2),x)

[Out]

Integral(1/(sqrt(1 - sin(x))*sqrt(sin(x))), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 146 vs. \(2 (24) = 48\).
time = 0.87, size = 146, normalized size = 4.71 \begin {gather*} \frac {\sqrt {2} {\left (\log \left (\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} - \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 1\right ) - \log \left ({\left | -\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 3 \right |}\right ) - \log \left ({\left | -\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 1 \right |}\right )\right )}}{2 \, \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, x\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-sin(x))^(1/2)/sin(x)^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(2)*(log(tan(-1/8*pi + 1/4*x)^2 - sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 1) - l
og(abs(-tan(-1/8*pi + 1/4*x)^2 + sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 3)) - log(abs(-
tan(-1/8*pi + 1/4*x)^2 + sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 1)))/sgn(sin(-1/4*pi +
1/2*x))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {1}{\sqrt {\sin \left (x\right )}\,\sqrt {1-\sin \left (x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)^(1/2)*(1 - sin(x))^(1/2)),x)

[Out]

int(1/(sin(x)^(1/2)*(1 - sin(x))^(1/2)), x)

________________________________________________________________________________________